//判断登录状态，并进行跳转
export function goToLogin() {
  if (typeof android != 'undefined' && android.getLoginJS) {
    var loginStatus = typeof android != 'undefined' && android.getLoginJS ? android.getLoginJS() : "";
    if (loginStatus == 0) {
      android.startLoginJs();
    } else {
      alertinfo('您还没有登录，马上跳转到登录页面~~');
      setTimeout("window.location.href = '//bbs.360.cn/member.php?mod=logging&action=login'", 2000);
    }
  } else {
    alertinfo('您还没有登录，马上跳转到登录页面~~');
    setTimeout("window.location.href = '//bbs.360.cn/member.php?mod=logging&action=login'", 2000);
    return;
  }
}
export function getDocumentCookie(){
  var cookiepre = "";
  if (document.cookie && document.cookie != '') {
    var cookies = document.cookie.split(';');
    var re = /yTGF__.*_userinfo/;
    for (var i = 0; i < cookies.length; i++) {
      if (re.test(cookies[i])) {
        var cookie = cookies[i].split("=");
        cookiepre = cookie[0].trim();
        continue;
      }
    }
  }
  return cookiepre;
}